package com.ssm.driver.service.impl;

import com.ssm.driver.entity.vo.InentoryVo;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssm.common.utils.PageUtils;
import com.ssm.common.utils.Query;

import com.ssm.driver.dao.SsmInventoryDao;
import com.ssm.driver.entity.SsmInventoryEntity;
import com.ssm.driver.service.SsmInventoryService;

import javax.annotation.Resource;


@Service("ssmInventoryService")
public class SsmInventoryServiceImpl extends ServiceImpl<SsmInventoryDao, SsmInventoryEntity> implements SsmInventoryService {
    @Resource
    SsmInventoryDao sqlStatement;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SsmInventoryEntity> page = this.page(
                new Query<SsmInventoryEntity>().getPage(params),
                new QueryWrapper<SsmInventoryEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public ArrayList<InentoryVo> getBysjId(Integer sjId) {
//        ArrayList<SsmInventoryEntity> intoryList = (ArrayList<SsmInventoryEntity>) baseMapper.selectList(new QueryWrapper<SsmInventoryEntity>().eq("sj_id", sjId));
        return sqlStatement.selectInventory(sjId);
    }

}